﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GsifWeb4.Models;

namespace GsifWeb4.Controllers
{
    public class HomeController : Controller
    {
        gsifdbEntities gsifDB = new gsifdbEntities();

        public ActionResult Index()
        {
            // Get latest news
            var n = gsifDB.laget_gsif.FirstOrDefault();
            //var news = (from nyheter in gsifDB.nyheter_gsif orderby nyheter.Id_Datum descending select nyheter).Take(5).ToList();
                
            ViewBag.Message = "News: " + n.FNamn + " st";

            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
